
#pragma once
#include "stdafx.h"

class CWicBitmapEncoder;

class CLASS_DECLSPEC CWicBitmapFrameEncode 
{
    //==============================================================================
    // CWicBitmapFrameEncode
    //==============================================================================
public:
    CWicBitmapFrameEncode(CWicBitmapEncoder *pIWICBitmapEncoder, IPropertyBag2 **ppIEncoderOptions);
    CWicBitmapFrameEncode(CWicBitmapFrameEncode const &);
    virtual ~CWicBitmapFrameEncode(void);
    CWicBitmapFrameEncode& operator=(CWicBitmapFrameEncode const &);

    //==============================================================================
    // IWICBitmapFrameEncode
    //==============================================================================
public:
    virtual HRESULT STDMETHODCALLTYPE Initialize( 
        /* [unique][in] */ __RPC__in_opt IPropertyBag2 *pIEncoderOptions);

    virtual HRESULT STDMETHODCALLTYPE SetSize( 
        /* [in] */ UINT uiWidth,
        /* [in] */ UINT uiHeight);

    virtual HRESULT STDMETHODCALLTYPE SetResolution( 
        /* [in] */ double dpiX,
        /* [in] */ double dpiY);

    virtual HRESULT STDMETHODCALLTYPE SetPixelFormat( 
        /* [out][in] */ __RPC__inout WICPixelFormatGUID *pPixelFormat);

    virtual HRESULT STDMETHODCALLTYPE SetColorContexts( 
        /* [in] */ UINT cCount,
        /* [size_is][in] */ __RPC__in_ecount_full(cCount) IWICColorContext **ppIColorContext);

    virtual HRESULT STDMETHODCALLTYPE SetPalette( 
        /* [in] */ __RPC__in_opt IWICPalette *pIPalette);

    virtual HRESULT STDMETHODCALLTYPE SetThumbnail( 
        /* [in] */ __RPC__in_opt IWICBitmapSource *pIThumbnail);

    virtual HRESULT STDMETHODCALLTYPE WritePixels( 
        /* [in] */ UINT lineCount,
        /* [in] */ UINT cbStride,
        /* [in] */ UINT cbBufferSize,
        /* [size_is][in] */ __RPC__in_ecount_full(cbBufferSize) BYTE *pbPixels);

    virtual HRESULT STDMETHODCALLTYPE WriteSource( 
        /* [in] */ __RPC__in_opt IWICBitmapSource *pIBitmapSource,
        /* [unique][in] */ __RPC__in_opt WICRect *prc);

    virtual HRESULT STDMETHODCALLTYPE Commit( void);

    virtual HRESULT STDMETHODCALLTYPE GetMetadataQueryWriter( 
        /* [out] */ __RPC__deref_out_opt IWICMetadataQueryWriter **ppIMetadataQueryWriter);

private:
    IWICBitmapFrameEncode  *m_pIWICBitmapFrameEncode;
};

